#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{ 
	int m = 0;
	int sum = 0;
	int e = 0;
	scanf("%d", &m);
	e = m;
	sum = m;
	while (e > 1)
	{
		sum = sum + e / 2;
		e = e % 2 + e / 2;
		
	}
	
	printf("%dƿ\n", sum);
	return 0;
}